package com.example.jetpack_databinding.main1

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import com.example.jetpack_databinding.R
import com.example.jetpack_databinding.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        var activityMainBinding: ActivityMainBinding =
            DataBindingUtil.setContentView<ActivityMainBinding>(this, R.layout.activity_main)

        val person = Person("张三", 25)
        activityMainBinding.person=person
        activityMainBinding.myOnclickListener= MyOnclickListener(this)
    }
}